package com.baturu.vin.benz.dal.dao;

import com.baturu.vin.benz.dto.BenzRulesDTO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author: chenjiahao
 * @Time: 2018/10/19
 */
public interface BenzRulesDAO {

    @Select({"<script>",
            "SELECT rule,btrPartsName",
            "FROM benz_self_rules",
            "WHERE btrPartsName IN ",
            "<foreach item='btrPartsName' index='index' collection='btrPartsNames' open='(' separator=',' close=')' >",
            "   #{btrPartsName}",
            "</foreach>",
            "</script>"
    })
    List<BenzRulesDTO> queryRules(@Param("btrPartsNames") List<String> btrPartsNames);
}
